import {createApp} from 'vue'
import App from './App.vue'
import router from './router'
// import ElementPlus from 'element-plus'  // 全量引入
// app.use(ElementPlus)

// 按需引入
import {
    ElButton,
    ElHeader,
    ElAside,
    ElContainer,
    ElFooter,
    ElMain,
    ElMenu,
    ElSubMenu,
    ElMenuItem,
    ElIcon,
    ElCard,
    ElTable,
    ElTableColumn,
    ElInput,
    ElRow,
    ElCol,
    ElPagination
} from 'element-plus'
import 'element-plus/dist/index.css'

import './assets/main.css'

const app = createApp(App)

// 图标使用
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }

app.use(router)
app.use(ElButton)
    .use(ElHeader)
    .use(ElAside)
    .use(ElContainer)
    .use(ElFooter)
    .use(ElMain)
    .use(ElMenu)
    .use(ElSubMenu)
    .use(ElMenuItem)
    .use(ElIcon)
    .use(ElCard)
    .use(ElTable)
    .use(ElTableColumn)
    .use(ElInput)
    .use(ElRow)
    .use(ElCol)
    .use(ElPagination)

app.mount('#app')
